/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fanta.framework.persistence;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author alessandro
 */
@Entity
@Table(name = "modulo")
@NamedQueries({
    @NamedQuery(name = "Modulo.findAll", query = "SELECT m FROM Modulo m"),
    @NamedQuery(name = "Modulo.findById", query = "SELECT m FROM Modulo m WHERE m.id = :id"),
    @NamedQuery(name = "Modulo.findByNumeroD", query = "SELECT m FROM Modulo m WHERE m.numeroD = :numeroD"),
    @NamedQuery(name = "Modulo.findByNumeroC", query = "SELECT m FROM Modulo m WHERE m.numeroC = :numeroC"),
    @NamedQuery(name = "Modulo.findByNumeroA", query = "SELECT m FROM Modulo m WHERE m.numeroA = :numeroA")})
public class Modulo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "numeroD")
    private int numeroD;
    @Basic(optional = false)
    @Column(name = "numeroC")
    private int numeroC;
    @Basic(optional = false)
    @Column(name = "numeroA")
    private int numeroA;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "moduloteam1")
    private Collection<Giornatelega> giornatelegaCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "moduloteam2")
    private Collection<Giornatelega> giornatelegaCollection1;

    public Modulo() {
    }

    public Modulo(Integer id) {
        this.id = id;
    }

    public Modulo(Integer id, int numeroD, int numeroC, int numeroA) {
        this.id = id;
        this.numeroD = numeroD;
        this.numeroC = numeroC;
        this.numeroA = numeroA;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getNumeroD() {
        return numeroD;
    }

    public void setNumeroD(int numeroD) {
        this.numeroD = numeroD;
    }

    public int getNumeroC() {
        return numeroC;
    }

    public void setNumeroC(int numeroC) {
        this.numeroC = numeroC;
    }

    public int getNumeroA() {
        return numeroA;
    }

    public void setNumeroA(int numeroA) {
        this.numeroA = numeroA;
    }

    public Collection<Giornatelega> getGiornatelegaCollection() {
        return giornatelegaCollection;
    }

    public void setGiornatelegaCollection(Collection<Giornatelega> giornatelegaCollection) {
        this.giornatelegaCollection = giornatelegaCollection;
    }

    public Collection<Giornatelega> getGiornatelegaCollection1() {
        return giornatelegaCollection1;
    }

    public void setGiornatelegaCollection1(Collection<Giornatelega> giornatelegaCollection1) {
        this.giornatelegaCollection1 = giornatelegaCollection1;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Modulo)) {
            return false;
        }
        Modulo other = (Modulo) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fanta.framework.persistence.Modulo[id=" + id + "]";
    }

}
